package com.woniu.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;



/**
 * @Classname RabbitMQConfig
 * @Description TODO
 * @Date 2025/10/24 15:58
 * @Created by pc
 */
@Configuration
public class RabbitMQConfig {

    // 异步发送验证码
    @Bean
    public Queue topicQueue(){
        return new Queue("topicQueue");
    }
    @Bean
    public TopicExchange topicExchange(){
        return new TopicExchange("topicExchange");
    }
    @Bean
    public Binding topicQueueToExchange(){
        return BindingBuilder.bind(topicQueue()).to(topicExchange()).with("regcode");
    }

}
